﻿@using NC.Infrastructure.Domain.Identity
@using NC.Infrastructure.DomainDto
@using NC.Service
@using NC.Web.Models
@model List<NC.Infrastructure.DomainDto.Record.RecordListDto>
@{
    ViewBag.Title = "Index";
}


<link href="~/Content/rippler/css/rippler.min.css" rel="stylesheet" />
<script src="~/Content/rippler/js/jquery.rippler.min.js"></script>
<script src="~/Content/Assert/Js/ListHelper.js"></script>
<section class="content-header">
    <h1>
        用户信息列表管理
    </h1>
    <ol class="breadcrumb">
        <li><a href=""><i class="fa fa-dashboard"></i>首页</a></li>
    </ol>
</section>
<section class="content">
    <div class="box box-primary">
        <div class="box-header with-border">
            <h3 class="box-title">Api接口记录信息</h3>
            <div class="row" style="margin-top: 20px;">
                <div class="col-md-4">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label class="col-md-2 control-label">网站</label>
                            <div class="col-md-10">
                                <select class="form-control" id="target" onchange="targetChange()">
                                    @*                                    @{*@
                                    @*                                        var targets = (List<SimpleDto>)ViewBag.targets;*@
                                    @*                                        int target = Request.QueryString["target"] == null ? 0 : Convert.ToInt32(Request.QueryString["target"]);*@
                                    @*                                        foreach (var item in targets)*@
                                    @*                                        {*@
                                    @*                                            if (item.Id == target)*@
                                    @*                                            {*@
                                    @*                                                <option value="@item.Id" selected="selected">@item.Value</option>*@
                                    @*                                            }*@
                                    @*                                            else*@
                                    @*                                            {*@
                                    @*                                                <option value="@item.Id">@item.Value</option>*@
                                    @*                                            }*@
                                    @*                                        }*@
                                    @*                                    }*@
                                </select>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-md-4">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label class="col-md-2 control-label">用户</label>
                            <div class="col-md-10">
                                <select class="form-control" id="person" onchange="personChange()">
                                    @*                                    @{*@
                                    @*                                        var persons = (List<SimpleDto>)ViewBag.persons;*@
                                    @*                                        int person = Request.QueryString["person"] == null ? -1 : Convert.ToInt32(Request.QueryString["person"]);*@
                                    @*                                        foreach (var item in persons)*@
                                    @*                                        {*@
                                    @*                                            if (item.Id == person)*@
                                    @*                                            {*@
                                    @*                                                <option value="@item.Id" selected="selected">@item.Value</option>*@
                                    @*                                            }*@
                                    @*                                            else*@
                                    @*                                            {*@
                                    @*                                                <option value="@item.Id">@item.Value</option>*@
                                    @*                                            }*@
                                    @*                                        }*@
                                    @*                                    }*@
                                </select>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-md-4">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <label class="col-md-2 control-label">搜索</label>
                            <div class="col-md-10">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="search" />
                                    <div class="input-group-btn">
                                        <button type="button" class="btn btn-info" onclick="search()">搜索</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="box-body no-padding">
            <div class="mailbox-controls">
                <!-- Check all button -->
                <button class="btn btn-default btn-sm checkbox-toggle" id="checkAll"><i class="glyphicon glyphicon-check"></i></button>
                <div class="btn-group">
                    <a href="@Url.Action("Create")" class="btn btn-default btn-sm"><i class="glyphicon glyphicon-plus"></i></a>
                    <button class="btn btn-default btn-sm" onclick="deleteData('@Url.Action("Delete")')"><i class="glyphicon glyphicon-trash"></i></button>
                    <button class="btn btn-default btn-sm" onclick="window.location.reload(true);"><i class="glyphicon glyphicon-refresh"></i></button>
                </div>
            </div>
            <div class="table-responsive mailbox-messages">
                <table class="table table-hover table-striped">
                    <thead>
                        <tr>
                            <td>
                                <img style="border-radius: 50%; width: 40px; height: 40px;" src="~/Content/Assert/image/logo.jpg" alt="猫神战" title="猫神战" />
                            </td>
                            <td>
                                网站名称
                            </td>
                            <td>
                                <span>AccessToken</span>
                            </td>

                            <td>
                                <span>接口地址</span>
                            </td>
                            <td>
                                调用时间
                            </td>
                            <td>
                                操作
                            </td>

                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>
                                <img style="border-radius: 50%; width: 40px; height: 40px;" src="~/Content/Assert/image/logo.jpg" alt="猫神战" title="猫神战" />
                            </td>
                            <td>
                                <a href="http://www.baidu.com">网站名称</a>
                            </td>
                            <td>
                                <span>sdoifj-23odid-345dfg</span>
                            </td>

                            <td>
                                <span>api/person/all</span>
                            </td>
                            <td>
                                2016-06-26 09:35
                            </td>
                            <td>
                                <div class="btn-group">
                                    <div class="btn btn-default" onclick="loadPage('@Url.Action("Details", new {id = 1})')">
                                        详细信息
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img style="border-radius: 50%; width: 40px; height: 40px;" src="~/Content/Assert/image/logo.jpg" alt="猫神战" title="猫神战" />
                            </td>
                            <td>
                                <a href="http://www.baidu.com">网站名称</a>
                            </td>
                            <td>
                                <span>sdoifj-23odid-345dfg</span>
                            </td>

                            <td>
                                <span>api/person/all</span>
                            </td>
                            <td>
                                2016-06-26 09:35
                            </td>
                            <td>
                                <div class="btn-group">
                                    <div class="btn btn-default" onclick="loadPage('@Url.Action("Details", new {id = 1})')">
                                        详细信息
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img style="border-radius: 50%; width: 40px; height: 40px;" src="~/Content/Assert/image/logo.jpg" alt="猫神战" title="猫神战" />
                            </td>
                            <td>
                                <a href="http://www.baidu.com">网站名称</a>
                            </td>
                            <td>
                                <span>sdoifj-23odid-345dfg</span>
                            </td>

                            <td>
                                <span>api/person/all</span>
                            </td>
                            <td>
                                2016-06-26 09:35
                            </td>
                            <td>
                                <div class="btn-group">
                                    <div class="btn btn-default" onclick="loadPage('@Url.Action("Details", new {id = 1})')">
                                        详细信息
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img style="border-radius: 50%; width: 40px; height: 40px;" src="~/Content/Assert/image/logo.jpg" alt="猫神战" title="猫神战" />
                            </td>
                            <td>
                                <a href="http://www.baidu.com">网站名称</a>
                            </td>
                            <td>
                                <span>sdoifj-23odid-345dfg</span>
                            </td>

                            <td>
                                <span>api/person/all</span>
                            </td>
                            <td>
                                2016-06-26 09:35
                            </td>
                            <td>
                                <div class="btn-group">
                                    <div class="btn btn-default" onclick="loadPage('@Url.Action("Details", new {id = 1})')">
                                        详细信息
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <img style="border-radius: 50%; width: 40px; height: 40px;" src="~/Content/Assert/image/logo.jpg" alt="猫神战" title="猫神战" />
                            </td>
                            <td>
                                <a href="http://www.baidu.com">网站名称</a>
                            </td>
                            <td>
                                <span>sdoifj-23odid-345dfg</span>
                            </td>

                            <td>
                                <span>api/person/all</span>
                            </td>
                            <td>
                                2016-06-26 09:35
                            </td>
                            <td>
                                <div class="btn-group">
                                    <div class="btn btn-default" onclick="loadPage('@Url.Action("Details", new {id = 1})')">
                                        详细信息
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</section>



<div class="modal fade" id="Framework">
    <div class="modal-dialog" style="width: 1500px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 class="modal-title" id="FrameworkTitle">接口详细信息</h4>
            </div>
            <div class="modal-body" id="FrameworkContent">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>

<script src="~/Content/Assert/Js/Common.js"></script>
<script type="text/javascript">


    $(document).ready(function () {
        $("#search").onKeyDown(function (e) {
            if (e.keyCode == 13) {
                search();
            }
        });
    });

    function personChange() {
        var personId = $("#person").val();
        var url = setUrlValue("person", personId);
        window.location.href = "@Url.Action("Index")" + url;
    }
    function targetChange() {
        var targetId = $("#target").val();
        var url = setUrlValue("target", targetId);
        window.location.href = "@Url.Action("Index")" + url;
    }

    function search() {
        var searchInfo = $("#search").val();
        var url = setUrlValue("search", searchInfo);
        window.location.href = "@Url.Action("Index")" + url;
    }



</script>
